/*
 *  Clocker.h
 *  Simple timer wrapper
 *
 *  Created by Michah Lerner on 8/5/08.
 *  Copyright 2008. All rights reserved.
 *
 */
#ifndef __CLOCKER_H__
#define __CLOCKER_H__
#include <sys/time.h>
#include <sstream>
#include <iostream>
#include <ostream>
#include <iomanip>
#include <string>

using namespace std;

class Clocker {
	timeval start, stop;
	unsigned long usageStart, usageEnd;
	public:
		Clocker() :
			start(), stop(), usageStart(), usageEnd() {
			begin();
		}
		virtual ~Clocker() { }
		void begin();
		void end();
		double getTimediff();
		unsigned long getUsage();
		string tod();
		string readAndReset();

};
#endif
